<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCircleNodePivotTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('circle_node_pivot', function (Blueprint $table) {
        	$table->unsignedInteger('line_id')->index();
        	$table->unsignedInteger('circle_id')->index();
        	$table->unsignedInteger('node_id')->index();
        	$table->time('time');
        	$table->primary(['line_id', 'circle_id', 'node_id']);
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('circle_node_pivot');
    }
}
